// physicalExam.ts
// 体检记录相关类型定义

// 体检记录接口
interface IPhysicalExam {
  id: number;
  TSetmealId?: number;
  TMemberId?: number;
  ExamDate?: string;
  ReportStatus?: number;
  Createtime?: string;
  Updatetime?: string;

  // 关联数据
    TMember?: ITMember;
    TSetmeal?: ITSetmeal;

    FileNumber?:string;
    MemberName?:string;
    PhoneNumber?:string;
    SetName?:string;
}

// 会员信息接口（体检记录中的嵌套对象）
interface ITMember {
  Id: number;
  FileNumber: string;
  Name: string;
  PhoneNumber: string;
}

// 套餐信息接口
interface ITSetmeal {
  Id: number;
  Name: string;
}

// 体检上传请求类型
interface IExaminationUpload {
  TSetmealId?: number;
  TMemberId?: number;
  ExamDate?: string;
}

// 体检记录查询参数
interface IPhysicalExamQueryParams {
  page?: number;
  size?: number;
  fileNumber?: string;
  name?: string;
  phoneNumber?: string;
}

// 体检记录分页响应
interface IPhysicalExamPageResult {
  state: number;
  code: string;
  msg: string;
  page: number;
  size: number;
  count: number;
  data: IPhysicalExam[];
}

// 单个体检记录响应
interface IPhysicalExamResult {
  state: number;
  code: string;
  msg: string;
  data?: IPhysicalExam;
}

// 文件上传响应
interface IUploadResult {
  state: number;
  code: string;
  msg: string;
  data?: {
    filePath: string;
    fileName: string;
    fileSize: number;
  };
}

// 报告状态枚举
enum EReportStatus {
  NOT_UPLOADED = 0,
  UPLOADED = 1
}

// 报告状态配置
interface IReportStatusConfig {
  text: string;
  color: string;
}

// 报告状态映射
type TReportStatusMap = {
  [key in EReportStatus]: IReportStatusConfig;
} & {
  _: IReportStatusConfig;
};

// 分页配置
interface IPaginationConfig {
  current: number;
  pageSize: number;
}

// 表格行选择配置
interface ITableSelection<T> {
  selectedRowKeys: React.Key[];
  selectedRows: T[];
  onChange: (selectedRowKeys: React.Key[], selectedRows: T[]) => void;
}

// 上传文件信息
interface IUploadFileInfo {
  fileList: any[];
  currentRecord: IPhysicalExam | null;
  uploading: boolean;
}

// 搜索参数
interface ISearchParams {
  keyword: string;
  fileNumber: string;
  name: string;
  phoneNumber: string;
}

// 常量定义
interface IPhysicalExamConstants {
  PAGE_SIZE_OPTIONS: string[];
  DEFAULT_CURRENT_PAGE: number;
  DEFAULT_PAGE_SIZE: number;
  REPORT_STATUS: TReportStatusMap;
}

export type {
  IPhysicalExam,
  ITMember,
  ITSetmeal,
  IExaminationUpload,
  IPhysicalExamQueryParams,
  IPhysicalExamPageResult,
  IPhysicalExamResult,
  IUploadResult,
  IReportStatusConfig,
  TReportStatusMap,
  IPaginationConfig,
  ITableSelection,
  IUploadFileInfo,
  ISearchParams,
  IPhysicalExamConstants
};

export { EReportStatus };